﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using TA.DotNetUtils;

namespace TA.Turbo.Controls
{
	/// <summary>
	/// The previous page button.
	/// </summary>
	public class RepeaterPageButtonPrevious : BaseRepeaterPageButton
	{
		internal RepeaterPageButtonPrevious(Repeater repeater)
			: base(repeater)
		{

		}
		/// <summary>
		/// Gets PagerSettings.Previous.
		/// </summary>
		public override PagerElement PagerElement
		{
			get { return this.PagerSettings.Previous; }
		}
		/// <summary>
		/// Gets the index to the left from the Repeater's current page index.
		/// </summary>
		public override int Index
		{
			get { return Math.Max(0, this.Repeater.ActualPageIndex - 1); }
		}
		/// <summary>
		/// Gets "previous".
		/// </summary>
		public override string CssClass
		{
			get { return "previous"; }
		}
	}
}